package kr.hkit.powerjava.chapter11;

/*class ExtString extends String{
	
}*/

public class Student {

	private int stdNum;
	private String stdName;
	
	public Student(){}
	public Student(int stdNum, String stdName) {
		this.stdNum = stdNum;
		this.stdName = stdName;
		
	}
	
	public void add(){
		
	}
	
	public boolean equals(Object obj) {
		if (obj instanceof Student){
			return stdNum ==((Student)obj).stdNum;
		
	}else{
		return false;
	}
	}
	public static void main(String[] args) {
		Student std01 =new Student(1, "김태희");
		Student std02 =new Student(1, "김태희");
		
		System.out.println(std01.equals(std02)?"같다":"다르다");
	}
	
}
